When assigning and dealing combat damage from an attacking creature with Trample, its controller must assign what would be lethal damage to all blocking creatures. Any damage in excess of this can then be assigned to the defending player.
For example, if an attacking Yavimaya Wurm is blocked by two Runeclaw Bears, when the combat damage step begins the controller of the Wurm must assign and deal at least two points of damage to each of the Bears and can assign up to two points of damage to the defending player.