A multiwavelength investigation of candidate millisecond pulsars in unassociated γ-ray sources