Preheat the oven to 350 degrees and grease two 6-inch round cake pans. Line the bottoms with parchment paper.
In a medium bowl, whisk together the flour, cocoa powder, sugar, baking soda, and salt. In a separate bowl, whisk the buttermilk, oil, egg, red food coloring, vinegar, and vanilla until smooth. Pour the wet mixture into the dry ingredients and stir until just combined.
Divide the batter evenly between the prepared pans. Bake for 22 to 25 minutes, or until a toothpick inserted in the center comes out clean. Cool the cakes in the pans for 10 minutes, then turn them out onto a wire rack to cool completely.
Beat the cream cheese and butter together until creamy. Gradually add the powdered sugar and mix until smooth. Place one cake layer on a plate and spread with a thin layer of frosting. Add the second layer and cover the top and sides with the remaining frosting.
Warm the raspberry preserves slightly in the microwave for 10 seconds, then drizzle over the top of the cake so it runs down the sides. Scatter fresh raspberries over the top before serving.