Like arach mentioned, trilobites and chelicerates (horse shoe crabs, spiders, etc) are very distantly related.
Traditionally four subphyla of arthropods, Crustacea, Chelicerata, Trillobitomorpha, and Unirama (although the latter is almost certainly polyphylectic) were recognized. The relationship between the four is unknown, and it is possible that at least one of those represents an independantly derived arthropod bauplan.
Where the trilobites differ in a signicant manner from chelicerates is in the presence of antennae in front of the mouth. Chelicerates lack preoral appendages. This may not seem like a big difference, but is really significant.
More recent analyses are strongly suggesting that the 'uniramians' (insects, millipedes, centipedes) are close to the crustaceans (united as the Mandibulata) and are a sister taxon to the Trilobitomorpha - Chelicerata clade (called the Arachnomorpha).
A good summary of this and other suggested phylogenies can be found at:
Palaeos: Page not found
About the evolution of terrestrial arthropods... Well not much is known. In all liklihood the arachnids (spiders and their kin) derived from forms similar to the extinct sea scorpions, the Euryptida. Modern scorpions are the least derived of the arachnids (mites and ticks, the Acarii, being the most derived).
There is a possible centipede-like marine arthropod from the Cambrian, and clear terrestrial primitive myriopods from the Silurian. My invert zoo papers are at school in my office. Somewhere here at home in all of my reprints I have an excellent article by Ed Bousfield on arthropod mouthpart morphology that I think has subsequently (more or less) been in agreement with more recent genetic work and cladistic analyses.
Doctor Bashir: "Of all the stories you told me, which were true and which weren't?"
Elim Garak: "My dear Doctor, they're all true"
Doctor Bashir: "Even the lies?"
Elim Garak: "Especially the lies"