Preheat oven to 180C/160 fan/gas 4. Line a muffin tin with 10 paper muffin cases.
Cream together the softened butter and caster sugar, along with the vanilla extract, until pale and fluffy.
Sift in the flour and cocoa powder. Add the two beaten eggs and mix well, taking care to stop once all of the dry ingredients are incorporated.
Divide the mixture evenly between the cupcake cases, and bake for 22-25 minutes.
For the buttercream: Rub the softened butter into the sieved icing sugar and cocoa powder using the back of a wooden spoon. Add the milk. Once the icing sugar has been incorporated, whisk with an electric mixer until light and fluffy.
Pipe the chocolate buttercream on top of each cupcake and insert a lollipop into the middle.
Cut 10 x 10cm dia circles of sugarpaste and place on top of each lollipop, using your fingers to shape into a ghost. Pipe eyes onto the ghosts using black royal icing or a little of the chocolate buttercream.