When a creature in combat has first strike or double strike, there are two combat damage phases. In the first phase, only creatures with first strike and double strike deal damage, and in the second, only creatures without first strike deal damage.
When a creature in combat has trample, all damage past what is necessary to deal lethal damage to all blockers is dealt directly to the defending player.
What this means specifically for your question is:
In the first example, a 7/7 ogre with double strike and trample is blocked by 3 2/2 creatures. In the first combat damage phase, the ogre distributes 2 damage to each blocker and 1 damage to the defending player. Then, in the second combat damage phase, there are no surviving blockers, so the ogre deals all 7 damage to the defending player.
In the second example, the same ogre is blocked by 2 5/5 creatures. In the first combat damage phase, the ogre distributes 5 damage to one of its blockers and 2 to the other, destroying the first one. Then in the second combat damage phase, the ogre distributes 3 damage to the remaining blocker and 4 damage to the defending player, killing the other blocker. The blocker also deals 5 damage to the ogre, which is not enough to destroy it.