You can pay as you go or buy a one day (or one week) pass.
Kids under 5 are free. 5 and up pay the same fare.
For pay as you go, there are different prices depending on how far you are traveling.
A one day pass is 9 dollars. That is a good deal if you are doing multiple trips or traveling a far distance.
http://www.wmata.com/fares/purchase/passes.cfm#rail
Use the links on this page to find maps and more info:
http://www.wmata.com/rail/
Coming up from Williamsburg, you could stay near one of the Metro stations on the blue or yellow lines south of DC.
Traffic on 95 from Willamsburg to DC can be brutal. Give yourself plenty of time to get where you are going.
I went to college in Williamsburg. Have a great trip but be prepared in DC and Wmsburg to have sweltering summer heat and humidity. If you've been to WDW in the summer, you should be fine.