We used this successfully on a mobile robot for detecting obstacles. Accurate to sub-inch against hard surfaces. It is calibrated for my altitude and climate, you may need to adjust the InchConversionFactor and LatencyTicks for your environment. If you want it to read centimeters, just add your own TicksToCentimeters function.
Enjoy and feel free to improve it.
2012/04/03 - Corrected pin documentation on constructor