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