IRobot swung to a profit in the first quarter and trimmed its outlook for full-year losses after the company completed most of its planned cost cuts.