The post a couple spots above mine is wrong...in the sentence, "I gave him a pen," "him" is the indirect object and "a pen" is the direct object. He gave a pen. He did not give him (as a gift, I would presume?). The indirect object always comes before the direct object in English.