First off, download and read Kevin Watsons encoder code and encoder FAQ
http://www.kevin.org/frc/encoder/
http://www.kevin.org/frc/frc_encoder.zip
To make his code work with the gear tooth sensors you need to remove the "Phase B" logic from it.
Second you wire them to digital I/O 1 and digital I/O 2 with a pwm cable. You also need to power them on a 12volt power supply as well.
See the 2007 Sensor Manual for more information.