In your sentence, to drive is the direct object. In the wordreference link that you provided, they incorrectly describe me as the direct object. This article explains how to tell the difference between direct and indirect objects.
Here is an example from section 122.2.a of the "Oxford Guide to English Grammar" (John Eastwood, 1994) that describes verbs that take an object and a to-infinitive:
"The doctor told Celia to stay in bed".
Here Celia is the indirect object, and the infinitive clause is the direct object.
Verbs like give can take a direct object (DO) and an indirect object (IO). Note that some people refer to the indirect object as a preposition object when a preposition is present. These verbs can be used in two ways:
He gave the book to me - DO=the book, IO= me
He gave me the book - DO=the book, IO= me
The same applies for the verb teach
He teaches English to foreign students - DO= English, IO=foreign students
He teaches foreign students English - DO= English, IO=foreign students
When the subject is an activity, you can use a to-infinitive (to ski) or a gerund (skiing) to describe the activity. You can use a gerund exactly like the above examples, however the situation is not the same with a to-infinitive:
He teaches foreign students to ski- DO= to ski, IO=foreign students
In the earlier examples, to is a preposition that attaches the indirect object, and it was possible to express the same concept in two ways (DO-IO and IO-DO). In this example, however, to is an infinitive marker: the only valid form is the IO-DO form.