A nation must apply via the Security Council. Their assessment and recommendation is passed to the General Assembly, who vote on whether or not the nation should join.
The Vatican City, Kosovo, and Taiwan are the only independent states that are not currently members. http://geography.about.com/cs/countries/a/numbercountries.htm