Thre are lot of information about stepper motor at Microchip.com. If you search you will find exsamples and source codes. Here are some:
AN906 Stepper Motor Control Using the PIC16F684
AN822, Stepper Motor Microstepping with PIC18C452
Bipolar Stepper Motor Driver
Bipolar Stepper Motor Driver (Full Version). ... Message.
You can also search on the web for Stepper Motor Controller + PIC ... You will find other information on stepper motor too.
You will find many informations (math + calculation) about stepper motor and controller. Simple stepper motor driver for Bipolar and Unipolar.
Or goto: http://www.piclist.com/techref/io/stepper/linistep/index.htm
Here you will find a very simple but good Stepper Motor Driver with microstep. It use TIP122 to drive Unipolar stepper and it supports the standard modes:
200 step - full step
400 step - half step (with Full Torque)
1200 step - microstep 6th!
3600 step - microstep 18th!
It is open source code and give you schematic and PCB for you to build your own. Very good project, must see.