Automatic conversion of winmd to DLL-Collection of common programming errors

I’d like to create a tool that accepts a .winmd file (Windows Runtime Component) and generates a C# DLL out of it (containing all the public types defined in the component).

As far as I’ve learned, standard .NET Reflection APIs cannot work on .winmd files, and one must used the Metadata Unmanaged APIs to access that information.

The question is — is it possible to construct a C# assembly out of the information that is retrieved from the Metadata API?

Or better yet — is there a tool (like TLBIMP) that already does this job or something similar?