How many people came to the meeting?
Here, the subject is "how many people". Regardless of what label you assign this structure, the interrogative "how" is a part of the complete subject.
Some number (of people) came to the meeting.
How much time does it take?
Here, the subject is "it". "How much time" is the object. Regardless of what label you assign this structure, the interrogative "how" is not a part of the subject.
It takes some amount (of time).
In the second example, we have reason to move words and phrases to change the statement into a question.
We can start with:
"it takes how much time"
and then (with do-support) bring the first word of the verb to the front:
"does it take how much time"
and finally move the phrase with the interrogative word to the front:
How much time does it take?
In the first example, we don't have any good reason to move anything. But, just for fun, let's do it anyway.
We can start with:
"how many people came to the meeting"
and then (with do-support) bring the first word of the verb to the front:
"did how many people come to the meeting"
and next move the phrase with the interrogative word to the front:
"how many people did come to the meeting"
and finally recognize that "did come" looks emphatic. If we don't want that extra emphasis, we can remove the auxiliary "did":
How many people came to the meeting?
and we're right back where we started, wondering why we did so much work.
As a rule of thumb, we simply assume that a question about the subject ends up changing nothing. However, we can only make use of that rule after we've already determined what does and doesn't count as the subject.