Historical versions of the U.S. Code are available on HeinOnline (1925-2012), Westlaw Edge (1990+), Lexis Advance (1992+) and Govinfo (1994+).
Historical versions of state statutes are available on HeinOnline in the State Statutes: Historical Archive library. Coverage varies by state, but primarily early historical codes. Westlaw & Lexis coverage for historical state statutes varies by state, but generally begins in mid-1980s.
The PLRC has historical state statutes in print and on microform. Ask a reference librarian for assistance.