Typelib situation is different, because stdole typelib does not contain much to begin with. Metadata files are going to contain most of the things as I understand.
From what I understand, winmd files are the WinRT equivalent of typelibs. Both contain descriptions for interfaces/struct/enums/(runtime)classes/etc. Native also uses them to generate proxy/stubs from winmd metadata, like typelib marshaling.
Do they have API to create metadata files?
There's [`IMetaDataDispenser::DefineScope`](https://learn.microsoft.com/en-us/windows/win32/api/rometadataapi/nf-rometad...), which lets you get a `IMetaDataEmit` to emit metadata tables. This is probably what MIDL is using in the first place.
If API-visible things like order of elements is different, that should be addressed I think.
I believe that depends on how the order of how the types are defined/declares in the IDL file itself. I'm pretty sure that's also not guaranteed to be stable between updates/releases.