How to use in your the project the COM reference “HNetCfg.HNetShare”, which can be found in the “hnetcfg.dll” server (typically located in the “C:\WINDOWS\system32\” directory).

private const string CLSID_NETSHARINGMANAGER =  
 "{5C63C1AD-3956-4FF8-8486-40034758315B}";


private static NETCONLib.INetSharingManager GetSharingManager()
{
 Type objectType = Type.GetTypeFromCLSID(
  new Guid(CLSID_NETSHARINGMANAGER));
 return Activator.CreateInstance(objectType)
  as NETCONLib.INetSharingManager;
}

void Main(){
     //Now i can use NET version of COM 'HNetCfg.HNetShare'
     INetSharingManager icsMgr = GetSharingManager();
}