Is a vocative used as a subject in a sentence? If not, what is it used for? (By the way, what is the linguistic term that corresponds to the classification of the components in a sentence into subject, object, ...?)
Technically, no - because what follows the vocative is usually either an imperative, which has no subject, or addresses the audience using a pronoun, which then becomes the subject.
David! Come here!
The vocative attracts the attention of the audience, and then the imperative addresses them directly without the use of a subject.
David! You must come here!
The statement uses the pronoun 'you' as the subject.
From a more practical point of view - the whole point of the evocative is to indicate the 'missing' subject so that the right person or group will understand the command or request.