I was too optimistic saying that there are many examples for a MASM-C-combination in the net. Here a step-by-step instruction for Visual Studio Express 2010 (no Masm32):
MathFuncsLib.cpp:
extern "C" {
int Addition (int a, int b) { return a + b; }
int Subtraction (int a, int b) { return a - b; }
int Multiplication (int a, int b) { return a * b; }
int Division (int a, int b) { return a / b; }
} // end of extern "C"
MathFuncsLib.asm:
.MODEL flat, stdcall
includelib kernel32.lib
ExitProcess PROTO STDCALL, :DWORD
includelib msvcrt.lib
printf PROTO C, :VARARG
includelib MathFuncsLib.lib
Addition PROTO C, :SDWORD, :SDWORD
Subtraction PROTO C, :SDWORD, :SDWORD
Multiplication PROTO C, :SDWORD, :SDWORD
Division PROTO C, :SDWORD, :SDWORD
.data
arg1 SDWORD 100
arg2 SDWORD 10
result SDWORD ?
fmt1 db "Addition: %u",10,0
fmt2 db "Subtraction: %u",10,0
fmt3 db "Multiplication: %u",10,0
fmt4 db "Division: %u",10,0
.code
main PROC
invoke Addition, arg1, arg2
mov result, eax
invoke printf, ADDR fmt1, result ; printf (fmt1,result)
invoke Subtraction, arg1, arg2
mov result, eax
invoke printf, ADDR fmt2, result
invoke Multiplication, arg1, arg2
mov result, eax
invoke printf, ADDR fmt3, result
invoke Division, arg1, arg2
mov result, eax
invoke printf, ADDR fmt4, result
invoke ExitProcess, 0
main ENDP
END main
MathFuncsLib.cmd:
@ECHO OFF
call "C:\Compiler\Visual Studio Express 2010\VC\vcvarsall.bat"
rem Adapt it with path to your 'vcvarsall.bat'
cl.exe MathFuncsLib.cpp /c
lib.exe MathFuncsLib.obj
ml.exe MathFuncsLib.asm /link /subsystem:console
MathFuncslib.exe
Good luck!