I found this C# example pretty helpful in figuring out how to generate new certificates.
Also this blog post covering the more general concepts
Other than that you'll need the platform SDK installed, which does also include several other examples (most in C++, but a couple in C# and VB too).