How to program an ATmega32 in C++ to control a LCD?
You could learn a lot by looking at the Arduino libraries for LCD control.

http://code.google.com/p/arduino/source/browse/trunk/libraries/LiquidCrystal/LiquidCrystal.cpp