Same problem here, it didn't work out for me using the sample code on that page. So I used the WMI provider framework from Gwyn Cole link to home page where one can download the framework. It works like a charm. It is based on ATL, so it is very maintainable in my humble opinion.
It also worked to create a provider with MI, but it had some stability issues, which will likely be my fault. But since WMI is deprecated, MI is the way to go. It's pretty interesting to find, that Microsoft developed an open source MI framework for Linux, which quite much overlaps with MI for Windows GITHub