What is the relationship between vernacular and literary Chinese?
What you call "literary Chinese" is actually classical Chinese, a rather static language that evolved 2500 years ago and has since been used as a model language in education, rituals and other rather fixed events.

Classical Chinese is therefore akin to Latin in Europe, actually covering approximately the same time span and the same usage.

You can pronounce classical Chinese the same way you pronounce contemporary spoken/written Chinese in any time, but it will differ from time to time since the spoken language changes continuously.

You will likely have no problems talking to Abe Lincoln in English, and perhaps also not conversing with Adam Smith or Isaac Newton, but might get into some problems understanding Shakespeare, and even more so Chaucer. The time you get to Beowulf, you are completely lost, not to mention the time of Britannia under Roman rule.

It is the same with Chinese. Qing Mandarin has some peculiar differences compared to contemporary Mandarin, like an additional tone and some now lost vowel varieties, but essentially it would be easy to converse with Qing people, all the way back to Cao Xueqin in the 1700s. Then it would become progressively harder, and you would eventually wind up in Middle Chinese and older varieties, which are incomprehensible to most modern ears. Actually, Cantonese is more akin to older Chinese, just like Swedish/Danish is more akin to Old English.

Students in China learn some classical Chinese, mainly poetry and some chengyu, and there is also a lot of classical expressions used in costume drama TV series covering imperial times. It is a heritage that is nurtured, but most people in China cannot (since the imperial education was abolished) actually understand more advanced classical Chinese, like ancient texts. Only specialists know how to decipher it.