Heat a dry skillet over medium heat and toast the guajillo and ancho chiles for 1 minute per side until fragrant. Place them in a bowl, cover with hot water, and soak for 15 minutes.
Drain the chiles and blend them with the diced tomatoes until smooth. Set the mixture aside.
Toss the corn kernels with 1 tablespoon olive oil and spread on a baking sheet. Broil for 5 to 7 minutes until some kernels char slightly, then set aside.
Warm the remaining tablespoon of olive oil in a large pot over medium heat. Add the onion and cook for 4 minutes until softened. Stir in the garlic, cumin, and oregano and cook for 1 minute more.
Add the lentils, vegetable broth, and blended chile mixture to the pot. Bring to a simmer, cover, and cook for 25 minutes.
Stir in the roasted corn and salt. Simmer uncovered for 10 more minutes until the lentils are tender.
Ladle into bowls and top with chopped cilantro and a squeeze of lime.