I think they do mileage tests inside labs, with cars propped on machines to allow the wheels to spin. Try
http://www.hybridcars.com/mpg-mystery.html to find out more about how the EPA does their estimates.
We are waiting for our '06 FEH to arrive in a few weeks!
pt