Preheat the oven to 350F. Butter and flour 2 9-inch cake pans. Place a piece of parchment paper that’s been trimmed to fit in the bottom of each buttered and floured pan. Lightly spray the parchment paper with nonstick cooking spray.
Whisk together the flour, cornstarch, baking powder, and salt in a medium bowl.
1 3/4 cups all-purpose flour, 1/4 cup cornstarch, 2 teaspoons baking powder, 1/2 teaspoon salt
Use a handheld electric mixer to cream together the butter and sugar in a large bowl. Beat in the eggs and vanilla until light and fluffy.
1 cup unsalted butter, 1 1/3 cups granulated sugar, 3 large eggs, 1 Tablespoon pure vanilla extract
Alternate between adding the dry ingredients and the milk until they’re both fully added, being careful not to over-mix. The batter will be thick.
2/3 cup whole milk
Remove 1 cup of batter to a bowl, and stir in the melted chocolate.
4 ounces semi-sweet chocolate
Divide the yellow batter evenly between the 2 prepared cake pans. Dollop the chocolate batter on top, and then gently swirl it in with a spatula.
Bake until the cakes are golden along the outside and a toothpick inserted in the center comes out clean, about 27 to 34 minutes.
Cool the cakes for 15 minutes in the pans, and then turn them out onto a wire rack to finish cooling, about 15 minutes. Peel off the parchment paper.
Making the Frosting
In a small saucepan or skillet, melt the butter over low heat.
16 Tablespoons butter
Mix in cocoa powder, stirring until the mixture is nice and thick.
2 cups unsweetened cocoa powder
Place chocolate mixture in the bowl of a stand mixer (or a large mixing bowl if using a hand mixer). Add ½ of the powdered sugar, mix until combined.
Add half of the heavy cream and the vanilla, mix until combined. Continue with remaining powdered sugar and cream.
4 teaspoons pure vanilla extract
Mix on medium speed for 5 minutes, until frosting is smooth and creamy.
Once the cakes are cooled, assemble the layer cake. Place 1 cake round onto a cake platter. Spread a layer of frosting on top. Place the second cake round on top of the frosting. Frost the top and sides of the cake.
You can also make this cake in a 9 by 13-inch dish instead of 2 9-inch cake pans. It will need to bake a little longer.
If you’re using 2 different cake pans, make sure to test them both with a toothpick for doneness because cooking time can vary depending on the cake pan.
It's best to use baking chocolate for this recipe over chocolate chips. If desired, you can remove an additional 1/2 cup or so of yellow cake batter for even more chocolate swirls, just be sure to add extra melted chocolate if doing so.