Lighting and shadowing aren't a trivial task and there are numberous ways to do it and each way can give another result, thus I dont think someone will just write you an example.
Someone has written a nice
library for lighting.
Other than thos there are many tutorials and examples other just google a bit.