Could you post a simple test source file to reproduce it ?
And give the commands to compile and link it.

Thank you for your responses! 

I've prepared simple test case, please download zip file from here:
http://holoborodko.com/pavel/downloads/mingw-test.zip

It contains two directories:
dll
test

"dll" has sources & scripts to build dll itself and test program (which uses the dll) by MinGW.
"test" has msvc project - test program which also uses same dll.

Additionally there are two files - configurations for gcc, used in compilation : specs, msvcr100. 
In my MinGW installation they live in mingw\lib\gcc\mingw32\4.7.0\ 
***

First, run make in "dll" directory - it will produce:
mingw-dll.dll
mingw-exe.exe

Then open MS solution in "test" and build the project. It will produce msvc-exe.exe and will copy it to "dll" automatically.

As a result, "dll" directory will have: 
mingw-dll.dll
mingw-exe.exe
msvc-exe.exe  

Two exe files are the test programs which use the same mingw-dll.dll
mingw-exe.exe always produce correct result (10 = 10).
msvc-exe.exe gives unpredictable output every time it runs (sometimes correct, sometimes not).

Everything is compiled with msvcr100 runtime. 

I would really appreciate any advice and help in this direction, since I am stuck at this problem.

Thank in advance,
Pavel.