http://xbox.create.msdn.com/en-us/education/catalog/sample/shadow_mapping_1
This sample shows you how to implement basic shadow mapping from a directional light where the view and projection of the shadow map adapt to the viewing frustum of the viewer’s camera. You can use the sample to shadow a large scene with multiple dynamic objects that cast dynamic shadows.