title: Call native C++ function from C#
body: <p>I have C++ legacy code with functions in the form:</p>
  
  <pre><code>double func(double)
  </code></pre>
  
  <p><strong>I have this as a source file</strong> -  it isnt in the form of a DLL although it could be turned into one if necessary</p>
  
  <p>How can I call <code>func</code> in my C# code (maybe over managed C++)? I heard of Marshalling and <code>DllImport</code> but I did not find MSDN very helpful.</p>