This is one of the eternally debated questions on forums like this.
Many US grads around here will snobbishly say you can't do anything as an IMG, because you're inferior from the start.
Many IMGs themselves feel inferior for whatever reason and preach doom and gloom. Still others are too idealistic and say the sky is the limit for everyone. Realistically, none of those viewpoints are correct all the time.
Mostly what you get depends on your USMLE step 1 scores. If you do really well on the USMLE, and manage to network well in the specialty you want during clinicals, and apply to a program that does not have a bias against IMG's you can get a competitive residency. It's possible, some have done it.
It takes some combination of hard work and a little luck. As an IMG, you would need more luck than a US grad.
It is hard to be more specific than this, because every program director has his or her own biases, schools offer different clinicals, people have varying work ethics, etc.
So the standard advice is to go to a US school if you can first, as the path is much easier overall. Students should work hard in med school, ace the step 1, and work hard in clinicals, and do their best no matter where you go. If you go off-shore, pick a school that has a good record of students doing well on the Step 1 and getting residencies similiar to the one you would want if possible.
Well, here come the flamers, so I'm out of here. Adios, amoeba!