
This sample shows how you can defer shadow map calculations to separate full-screen pass using a depth buffer, effectively decoupling your shadowing routines from your main lighting pass. The main benefits are that your pipeline can be greatly simplified, as well as improved efficiency during shadow occlusion generation. Uses XNA 3.0, includes PC and Xbox 360 projects. Hosted on Ziggyware.
http://www.ziggyware.com/readarticle.php?article_id=235
Also hosted here, since Ziggyware has been down: http://members.gamedev.net/MJP/DeferredShadowMaps.zip
I also wrote the code for a follow-up sample that implements Cascaded Shadow Maps, but never got around to doing a write-up. You can get that here: http://members.gamedev.net/MJP/DeferredCascadedShadowMaps.zip