I found your question because I had a similar problem.
In the end, I changed the discovery in Visio to use a registry key, generated the MP, and then edited the resulting XML to remove the registry-based discovery and replace it with a WMI query.
I my case, I wanted to discover the Print Server role (ID=135), so the discovery I used was this:
<Discovery ID="My.Management.Pack.Discovery.Print.Server.Seed" Enabled="true" Target="Windows!Microsoft.Windows.Server.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="My.Management.Pack.Class.Print.Server.Seed">
<Property TypeID="System!System.Entity" PropertyID="DisplayName" />
</DiscoveryClass>
<DiscoveryRelationship TypeID="Windows!Microsoft.Windows.ComputerHostsLocalApplication" />
</DiscoveryTypes>
<DataSource ID="DS" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
<NameSpace>\\$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$\ROOT\CIMV2</NameSpace>
<Query>
SELECT Name FROM Win32_ServerFeature WHERE ID=135
</Query>
<Frequency>14400</Frequency>
<ClassId>$MPElement[Name="My.Management.Pack.Class.Print.Server.Seed"]$</ClassId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
<Value>Print Server Seed</Value>
</Setting>
</Settings>
</InstanceSettings>
</DataSource>
</Discovery>