The CIDA (Cometary and Interstellar Dust Analyzer) instrument on the Stardust spacecraft is a time-of-flight mass spectrometer used to analyze ions formed when fast dust particles strike the instrument's target. In the spectra of 45 presumably interstellar particles, quinone derivates were identified as constituents in the organic component. The 29 spectra obtained during the flyby of Comet 81P/Wild 2 confirm the predominance of organic matter. In moving from interstellar to cometary dust, the organic material seems to lose most of its hydrogen and oxygen as water and carbon monoxide. These are now present in the comet as gas phases, whereas the dust is rich in nitrogen-containing species. No traces of amino acids were found. We detected sulfur ions in one spectrum, which suggests that sulfur species are important in cometary organics.