There is a Q&A about this on the U.S. Visas site:
My old passport has already expired. My visa to travel to the United States is still valid but in my expired passport. Do I need to apply for a new visa with my new passport?
No. If your visa is still valid you can travel to the United States with your two passports, as long as the visa is valid, not damaged, and is the appropriate type of visa required for your principal purpose of travel. (Example: tourist visa, when your principal purpose of travel is tourism). Both passports (the valid and the expired one with the visa) should be from the same country and type (Example: both Uruguayan regular passports, both official passports, etc.). When you arrive at the U.S. port-of-entry (POE, generally an airport or land border) the Customs and Border Protection Immigration Officer will check your visa in the old passport and if s/he decides to admit you into the United States they will stamp your new passport with an admission stamp along with the annotation "VIOPP" (visa in other passport). Do not try to remove the visa from your old passport and stick it into the new valid passport. If you do so, your visa will no longer be valid.