I'm unsure, in the sentence, since the "to be" verb is applying to homework, but comes after a plural, which is used?
What classes is the homework for?
What classes are the homework for?
You have correctly identified the subject of the sentence as "homework", which is a singular collective noun. So, you should use the singular form of the verb: "What classes is the homework for."
It may sound strange, because the word order is inverted and the verb comes after a plural noun, but the subject-verb agreement is all that matters. It may help if you think about answering the question, so that the word order goes back to normal:
"What classes is the homework for?"
"The homework is for classes A and C."