Recipe from Buttercup Bakes at Home. Makes two or three 9-inch round layers.
Preheat oven to 350°. Grease and lightly flour two or three 9-inch round baking pans. Line the bottoms with parchment paper.
Sift together flour, baking soda, and salt. Set aside.
Using an electric mixer on medium speed, mix butter and sugars until fluffy. Add eggs one at a time, beating well after each. Add chocolate, and mix until well incorporated. Add dry ingredients in three parts, alternating with buttermilk and vanilla. Beat until smooth. Stir in sour cream.
Divide batter equally and pour into prepared pans. Bake for 25-30 minutes, or until a toothpick inserted into the center comes out clean. Cool in pans for 10 minutes. Then, remove from pans and cool completely on wire racks.