title: Incorrect interop signature causing memory leak
body: <p>A 3rd party com module being used from c# via interop generated interface is leaking memory</p>
  
  <p>The 3rd party c++ method signature is:</p>
  
  <pre><code>somemethod(....., long** param3, long** param4)
  </code></pre>
  
  <p>The generated interop method is:</p>
  
  <pre><code>somemethod(...., IntPtr param3, IntPtr param4)
  </code></pre>
  
  <p>The last 2 params are assigned arrays by the umanaged dll, and are freed from c# Marshal.CoMemFree (dont remember exact sig atm)</p>
  
  <p>Using the same method from C++ via com interface and freeing in same way does not produce leaks</p>
  
  <p>Using tlbimp from the command line produces:</p>
  
  <pre><code>TlbImp : warning TI0000 : At least one of the arguments for
  'Sometype.somemethod' cannot be marshaled by the runtime
  marshaler. Such arguments will therefore be passed as a pointer and may
  require unsafe code to manipulate.
  </code></pre>
  
  <p>I find it surprising long** params can't be marshalled automatically.</p>
  
  <p>Have a better understanding of c++ (excl. Com black magic) than .net, but implementing the .net side...</p>
  
  <p>What is the correct way to access and free the memory passed back in param3 and param4. I suspect they should be 'out IntPtr'?</p>