Spread the dried beans on a rimmed baking sheet, pick out stones or debris, rinse under cold water, and soak in a large bowl covered with 8 cups cold water for 8 hours or overnight until plump.
Drain and rinse the beans, add them to a Dutch oven with 10 cups fresh water, the ham hock, and bay leaves. Boil, skim off foam, then reduce to a gentle simmer, partially covered, for 1 hour, stirring every 15 minutes and adding hot water if needed.
Heat olive oil in a large skillet over medium heat, cook the onion and green pepper for 8 to 10 minutes until soft, stir in garlic for 1 minute, then add cumin and oregano and stir for 30 to 60 seconds until fragrant. Remove from heat.
Scrape the sofrito into the beans with all its oil, deglaze the skillet with a ladle of bean liquid and add it back, then simmer partially covered for 30 to 45 minutes until beans are tender and broth is thick. Mash 1 cup of beans and stir back in to thicken.
Stir in the red wine vinegar, sugar, salt, and pepper, simmer for 5 minutes, then taste and adjust with more salt or vinegar as needed.
Remove the ham hock, cool 5 minutes, then shred the meat and discard bone, skin, and fat. Discard bay leaves, return the shredded ham to the pot, and simmer uncovered for 10 minutes if a thicker soup is desired.
Spoon about 1/3 cup cooked white rice into each warm bowl, ladle the hot soup over and around it, and top with chopped white onion, cilantro, a drizzle of olive oil, optional sour cream, and lime wedges.