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 =  

private static NETCONLib.INetSharingManager GetSharingManager()
 Type objectType = Type.GetTypeFromCLSID(
 return Activator.CreateInstance(objectType)
  as NETCONLib.INetSharingManager;

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