gcc -shared -o test.dll test.cpp
gcc -o usegcc.exe use.cpp -L. -ltest
gendef test.dll
lib /def:test.def /machine:x86 /out:test.lib
cl /Fe"usevc.exe" use.cpp test.lib
usegcc.exe
usevc.exe

うちの環境では問題ないなぁ