If you are not working with a buyer's agent under contract, then the real estate agent that you are dealing with, by Michigan law, is an agent or sub-agent of the seller. In the seller's best interest, then, your deposit would probably be banked immediately.
If you are under contract with a buyer's agent, working for YOUR best interests, the deposit should be made after all parties have put a signature on the purchase agreement. Sometimes with foreclosures or short sales, it can take weeks to get a seller-signed purchase agreement. It is to the buyer's advantage then to not deposit the check right away. If the deal falls apart, both parties may be required to sign to release it - especially if the broker has a third party (like a title company) hold all earnest deposits in a special account for that broker.
HOWEVER, some foreclosure & short sale sellers will require proof of the earnest money being deposited before they will even look at your offer! Then you have to decide if you want to risk losing the deposit.