This is a quick tutorial that should help you to use your C++ code as a DLL in C#
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.