http://www-personal.umich.edu/~johan...s/pos96rep.pdf
This link points to a document that explains how to do localization. The PDF pages 19 & 20 show the formula to convert wheel movement into position. For this to work your robot would need to pivot about the center wheels. If they are dropped some this often happens.
This isn't the total solution you are looking for but I think it will get you moving in the right direction.
If you have a gyro there is some default code that does all of this for you. Look in the targeting example code.
-Hugh