http://www.parallax.com/tabid/535/Default.aspx

Has a lot of good information. There are several examples of using IR sensors.

The code in the examples is in parallax's verson of basic.