As interrogatives "wh-" words are adverbs. They are old in English, and probably pre-date any development of Germanic dialects from the first Indo-European speakers.
These words are clearly related to the Latin "qu-" interrogatives such as "quis" quem" Quos" etc. In fact one can replace the English "wh-" with the Latin "qu-" and still be understood in English:
Quere are you going? Quat is that? etc.
Like Latin, the words seem related to the relative pronouns "who", "whose" etc, and "qui" , "quae" , "Quod" for example, in Latin.
As these interrogatives relate to action or being, they are adverbs.
Without doubt these words existed as far back as one can discover in the history of English. They have provided a means of asking questions, and some will place them in a special class of adverbs. I think that is extreme, as one will eventually have a special class for each word in the language
at some point, if the principle of "special" is carried forth .
It should be enough to know they are adverbs and how they should be used.