This sentence is in the imperative mood, so there is no subject (it´s implied to be the addressee). The verb is give, me is the indirect object (the target of give), and the rest of the sentence is the direct object.
The direct object is a complex noun phrase, with masses being the head, a set of determiner/adjective groups (your tired etc) as pre-modifiers, and a post-modifying clause yearning to breathe free. This could be interpreted as a relative clause with who are being omitted for poetic reasons.
[Note: I have labeled the possessive pronoun your as a determiner here, as it has the same function, and cannot be used at the same time as another determiner.]
UPDATE: It has occurred to me after Anton´s comment that there is also a slightly different interpretation of the direct object possible. Instead of it being a single noun phrase with the head masses, it could also be a list of three different groups of people:
- give me your tired (people)
- give me your poor (people)
- give me your huddled masses
This is ambiguous, so it really depends on how you read it. The adjectives tired and poor could in that interpretation also act as nouns.
So the direct object could either be a single noun (masses), or an enumeration of three. But this does not affect the overall sentence analysis otherwise.