Preheat your oven to 350°F (175°C). Line the muffin tin with cupcake liners.
In a mixing bowl, cream together the softened butter and sugar until light and fluffy. Add in eggs and vanilla extract, mixing well.
In another bowl, whisk together the flour, baking powder, and salt. Gradually add this dry mixture to the creamed mixture, alternating with the milk. Mix until just combined.
Divide the batter evenly among the prepared cupcake liners, filling each about ⅔ full. Bake for 18-20 minutes or until a toothpick inserted in the center comes out clean. Remove from oven and let cool for 5 minutes in the pan before transferring to a cooling rack.
Meanwhile, prepare the custard filling. In a saucepan, heat the milk over medium heat until it simmers. In a separate bowl, whisk the egg yolks, sugar, and cornstarch. Gradually add a small amount of the hot milk to the egg mixture while whisking constantly, then return this mixture to the saucepan.
Cook over medium heat, stirring continuously until the custard thickens (about 5-7 minutes). Remove from heat, stir in butter and vanilla extract, then let cool completely.
For the ganache, heat the heavy cream in a small saucepan until it begins to simmer. Remove from heat and add the chopped chocolate, stirring until melted and smooth.
Once the cupcakes are completely cooled, use a small knife or cupcake corer to remove a portion of the center of each cupcake. Fill the hollow with the custard filling.
Dip the tops of the filled cupcakes into the chocolate ganache or drizzle the ganache over the cupcakes with a spoon. Let the ganache set before serving.