I have created some libraries for ATmega32 peripherals and commonly used devices, each contains a .h and .cpp file. I have tried to include every kind of operation that can be done using peripherals and devices which can easily be modulated according to usage.
These can easily be converted into C code (if not familiar with c++), one of the reasons to use cpp is that it binds everything together which is a big advantage over c.
Usage : you just have to include the .h file in your main file and declare an object of class then simply call member functions using that object.