Typically, Latin dictionaries just lump these uses together, hence your confusion.
O (oh) can used with a number of cases other than the vocative when there's no addressing a person. For instance, the OLD entry (s.v. o²) treats them separately (probably because the OLD lexicographers used relevant data from the TLL entry - see below on this).
2.1 with the vocative, in addressing people or in adjurations;
2a-c.in expressions of admiration, pleasure, horror etc., "O what (a) ..., o how ...", examples with the nominative (2a), accusative (2b), and genitive (2c) listed separately again.
Pinkster 2015 (v.1, 6.35 Exclamatory sentences, pp. 361-368) also discusses this. While the vocative is used for address or invocation, exclamatory sentences on the other hand are used to express "disbelief, surprise, relief, indignation, misery or disgust about a certain state of affairs" (p. 361), cf.
accusativus exclamationis: O audaciam! (Ter.),
nominativus: O mirum commentum! (Apul.),
genitivus: O mercis malae! (Pl.)
The idea of address in the vocative - which the exclamatory uses discussed above cannot express - should be clear from this example: O stulte, stulte, nescis nunc venire te? (Pl.)
For a comprehensive, very detailed description, see the TLL entry (s.v. o) - it's 10 pages long! - esp. the first two sections, caput primum: exclamando (IIA. with the acc., IIB with nom., and IIC with the genitive) and caput secundum: appellando, vocando (with the vocative).