Theory of Magnetotransport in Ferromagnetic Mesoscopic Devices