Combine the sugar and cornstarch in a heavy saucepan. Gradually blend in the milk and whipping cream. Cook over medium heat, stirring constantly, until the custard comes to a boil and thickens.
Add a little of the hot milk mixture to the beaten eggs, then return the eggs to the saucepan and stir well. Heat to boiling, stirring vigorously.
Take the custard off the heat; stir in the chocolate, then the vanilla.
Pour into individual serving dishes to cool. Serve with whipped cream, if desired.