"En" replaces the noun.
Il a acheté une douzaine de roses == Il en a acheté une douzaine
Of course, you have to know that you're talking about roses. Usually, context has been established by a previous sentence:
Il est parti chercher des roses chez le fleuriste. Il en a acheté un douzaine.
As Random said, orally you can find things like "Il en a acheté une douzaine, de roses". Typically this can happen when you realise half sentence that you didn't provide context, so you just give it afterwards, or you thought you were being clear, but there is a possible confusion so you need to clarify.
You can also say this to emphasize :
Il en a acheté, des roses.
He sure did buy a lot of roses.
Other ways of using "en" :
Il a acheté une rose == Il en a acheté une
Il a acheté des roses == Il en a acheté