Midsize companies that employ millions of workers are now shedding jobs and relocating overseas to cut costs.