See the question and my original answer on StackOverflow

The issue was (apparently) due to an incorrect definition of the IMetaDataEmit interface.

Whatever the target language is, a COM interface definition must match the original binary layout exactly: all methods in same order (don't trust MSDN visual order on this), starting with derived interfaces methods (IUnknown, etc.), and exact binary-compatible signature for each method.