In top part of a double boiler, mix milk, chocolate, cocoa, and sugar. Place over simmering water and cook, stirring occasionally with a whisk, until chocolate has melted and mixture is smooth and hot, about 20 minutes. (Don't have a double boiler? Heat chocolate mixture in a small saucepan over a larger pan of boiling water.) Stir in coffee and heat through.
Pour into mugs, top with whipped cream and the chocolate shavings, if desired, and serve while warm.