My thesis has two main topics: the study of low-metallicity massive stars, and the study of the suspected final stage of massive stars from a certain initial mass range, the WO stars. All the data that has been used in this thesis has been obtained with the X-Shooter spectrograph on ESO's Very Large Telescope. As the formation of massive stars was favored in the metal-free early universe, the properties and evolution of low-metallicity massive stars gives insight in the influence of these stars in the young universe. I have quantitatively analyzed six O-type stars in the low-metallicity dwarf galaxies IC1613, WLM and NGC3109. These stars appear to have surprisingly strong winds, and do not agree with theoretical predictions. The analysis of four more O stars confirms this finding. The low-metallicity temperature scale, recent star formation history of the galaxies and the evolutionary state of the O stars are also discussed. The enigmatic WO stars are very rare (only 9 are known), and are thought to represent the final stage of some of the most massive stars. The spectra of most of these stars have never been modeled in detailed using expanding atmosphere codes. I have modeled the spectrum of the low-metallicity WO star DR1 and find abundances comparable to carbon Wolf-Rayet stars, but a much higher stellar temperature. The study of the other known single WO stars (5 in total) shows that most of them show very high carbon and oxygen abundances, and have less then 40% of helium left (by mass). The found stellar abundances will be used to constrain the initial masses of the stars and their evolutionary path. They are also used to constrain the illusive carbon to oxygen thermonuclear reaction rate.