Download the code samples here:
http://www.chiefdelphi.com/media/papers/2553. Look in the exampleRobotCode folder and open Periodic Tasks.vi. Near the bottom of the fast loop you'll see calculations that is stored into global variables called "Heading" and "AvgDist". These do exactly what you're looking for. As a bonus, you'll also find "CalcXY.vi" which calculates your x,y coordinate position on the field.
Note: The global "EncTrack" is the distance that separates the encoder wheels.