Microchip application note:
PICREF-4: PICDIM Lamp Dimmer for the PIC12C508
**broken link removed**
Includes C source code and schematic with zero cross detection.
Atmel AVR application note:
AVR182: Zero Cross Detector (7 pages, updated 3/02)
This Application Note describes how to implement an efficient zero cross detector for mains power lines using an AVR microcontroller. http://www.atmel.com/dyn/resources/prod_documents/DOC2508.PDF
PIC16F84 based TRIAC / IGBT phase controller for 50/60Hz brightness control http://microchipc.com/sourcecode/#triac
Includes C source code and schematic with zero cross detection.
You can also search google for "zero-cross detection" and you will find a lot of links.