Channel 9 has the main points to note, but the full source code and developer notes can be found at Code Project:
Why go to all this bother and both open source and explain everything? Well, the clue is in the final note:
This isn't a complete game at this point, but it's a great starting point and even in this state fun to play with and best of all, covers a number of important things, such as the physics engine, game state management, etc. If you're thinking about creating your own like game, this might be a great article and code to start your journey with...
I can't think of a better visual than building your smartphone app on top of a pirate. Yaaar!
PS when you're done, let us know about your application when it's in the Marketplace, contact details at the bottom of the page.