What is a good grade for an MS student expecting to apply for a PhD in a top-tier school? Although I understand that getting an admission into a PhD program depends on many factors, for example--BS and MS GPA, number of journal papers and their quality, number of conference papers and their quality, GRE, Statement of Objective, job experience, profile of other applicants, funding situation etc-- what should be the GPA of an MS student in the US, who is expecting to do a PhD in Mechanical Engineering in any of the top 30 grad schools?

Thanks in advance!
Anything above a 3.5. Grades higher than that are unlikely to make much of a difference for your application. The most important parts of your application are letters of recommendation, research experience, and personal statement. As long as the GPA is above 3.5, with no unexplained low grades in highly relevant courses, the precise GPA is not relevant.