First of all, I think using the optical sensors would actually be easier than trying to do what Woody called "Dead Reckoning". If you want some sample optical sensor code, we used them last year to track the goals. That code is available at my website and is called CogCode.
http://www.robbayer.com/software.html