Every thing is taken into consideration and one thing may compensate for the other supposed it is still in the acceptable range and it differs from program to program depending on the quality of people trained there and what that program interested in . Let me give an example; if you have 99/99 in USMLE with solid application and you applied to small community hospital, you may not be invited because the program knows you are taking them as backup and you may even not ranking them, and so on. From my opinion, because of huge amount of applications, programs screen applicants by USMLE scores, and then take all other factors into consideration.
The main this is USMLE scores. However, if you don't have the best scores...other things can contribute, especially LORs and depending what specialty, extracurriculars/research. Publications are helpful. Med school grades not so much because you might be in a completely different system that the US does not use and so therefore will not understand. Class rank may help, but again this isn't a definite. Although what mmed said above may happen...I don't think it'd be usual. As an IMG, they know that you may have less of a choice compared to a US graduate, so they may be more likely to think that you're not using them as a backup. So generally, when you apply for the Match...just apply to a wide group of programs with a lot of variety in the types of programs.