Preheat the oven to 375°F (190°C).
In a large skillet over medium heat, cook the ground beef, onion, bell pepper, and garlic until the meat is browned and the vegetables are tender, about 5-7 minutes. Drain any excess fat.
Stir in the black beans, corn, diced tomatoes (with juice), chili powder, cumin, salt, and black pepper. Let simmer for about 5 minutes.
In a mixing bowl, combine the cornmeal, buttermilk, egg, baking powder, and sugar (if using) until just mixed.
Spread the meat mixture evenly in the bottom of a greased 9x13 inch baking dish. Pour the cornbread batter over the top, spreading evenly.
Sprinkle the shredded cheese on top of the cornbread batter.
Bake in the preheated oven for 25-30 minutes, or until the cornbread is golden brown and a toothpick inserted in the center comes out clean.
Let the tamale pie cool for a few minutes before slicing and serving.