Yes, you can use external .NET dll in compiled MATLAB function.
For example, assume the name of external dll is 'dotNetExternalClass.dll'. In MATLAB function, you can load that dll with full path.
function out = compileOtherDll(in1, in2)
externalDllPath = fullfile(pwd, 'dotNetExternalClass.dll');
asm = NET.addAssembly(externalDllPath);
Then, compile this function as .NET assembly using deploytool. compileOtherDll.dll will be created in this case.
After that, in Visual Studio, it's needed to add compileOtherDll.dll and $MATLAB_INSTALL\toolbox\dotnetbuilder\bin\win64\v4.0\MWArray.dll as references and add "using" in C# codes.
After building this C# codes, you need to place the external dll (dotNetExternalClass.dll) in the same folder of exe file.