With out more details about what you are doing before the call to WSACleanup() it is hard to say.
I would check to make sure that any buffers that have been allocated and been used by the sockets library are not being freed to soon. Also check to make sure that any buffers you have recieved from the sockets library are being cleaned up by the owner of the buffer. The sockets library may be trying to free memory that you have already freed, or vice-versa.
Its been my experience that it is very difficult to make WSACleanup() crash. It doesn''t have problems when you free sockets before calling it... I have never succeeded in making it crash my system... and I usually manage to make every function crash my system at some time or another...
Perhaps if you are manually changing a sockets information before the call to cleanup. I.E. somehow changing the handle number, so when WSACleanup() goes to free it, it tries to free an invalid socket number.