What is the grammatical function of "how" in this sentence:
He told us how to do it.
In this sentence, the use of how is exactly parallel to some uses of whom.
He told us how to do it.
He told us whom to see about it.
However, in these uses, whom is officially classified as a relative pronoun, and how as a relative adverb (although sometimes it is called a subordinating conjunction). It makes you wonder whether the definitions of all these parts of speech were designed with a different language in mind, and the grammarians are shoehorning English into them as best they can.
The NOAD reports how is an adverb that means "in what way or manner, by what means."
She showed me how to adjust the focus.
It's a question word. It's found in your example, because the construction is an embedded question, and question words go in questions. "We asked him how to do it, and he told us how to do it; that is, he told us the answer to the question 'How do you do it?'."