"How many sheep does the child see?"
Translation:Kiom da ŝafoj vidas la infano?
That's a great point--nice example! It works out, though, because it's pretty rare to have the subject and the object have the form adverb+da+noun. And even then, context almost always makes it clear what the intended meaning is.
If you were really worried about getting your point across, you could say Kiom da ŝafoj vidas multaj infanoj or Kiom da ŝafoj vidas multajn infanojn, in which case the case-marking would come to the rescue.
Yes, in the sentence Kiom da ŝafoj vidas la infanon, 'How many sheep see the child', the da is part of the subject, so it has no effect on other parts of the sentence. The noun phrase right after da can never be accusative, but other than this very locally determined rule, everything works as normal.