DLL access is always slower than using it "in code". If you have the CPP code, why not simply import - extern it. Would give you a fair comparision and easy way to have other operations if needed. (fastRand?)
PS: Above test is a little unfair anyway. MOD against a power of 2 is like testing a car with round wheels against one with some other, no mather what they are (unless the car flies) ;-)
PS: Above test is a little unfair anyway. MOD against a power of 2 is like testing a car with round wheels against one with some other, no mather what they are (unless the car flies) ;-)