You'd use 'det'/'den' had the word already been introduced. 'det' and 'den' can only refer to something already stated, otherwise you'd use 'det'.
"Det er klassen. Den er liten." = "That/It is the class. It is small."
"Den er en liten klasse" = "That class is a small class."