You put it in the accusative, for example:
O mortalem malum! ("What a conniving personage!") Plautus
O corpusculum malacum! ("What a tender little body!") Plautus
O lepidum caput! ("What a delightful person!") Plautus
Bellum et pudicum uero prostibulum popli. ("What a sweet and chaste little street whore, indeed.") Plautus
Even if is only a single noun, the principle is still the same: it is placed into the accusative to make it exclamatory. For example:
iocularem audaciam! ("What a joke! What audacity!") Terence Phormio
These are all colloquial. In more literary Latin sometimes the nominative is used with or without supporting adverbs. For example:
Facinus indignum! ("What a shame!") Cicero, letter to Atticus.
O elegantia! O lepos! O venustas! O verba! O nitor! O argutiae! O kharites! Ο ἄσκησις! O omnia! ("What elegance! What wit! What beauty! What diction! What brilliance! What subtlety! What charm! What practised skill! What everything!") Fronto correspondence
Quale decus formae! ("What beauty of form!")