Dan,
I've written an example C program that does this. It's fairly well documented, so it shouldn't take too long to port. You can find the code here:
http://www.cvhsrobotics.org/resources.htm . It's in the "Dashboard Data Viewer Project Stuff" section. Feel free to e-mail me if you have questions.
Kevin