Are all IFR flights assigned squawk codes in US controlled airspace?
No.
/X (VOR only), /D (VOR/DME only), /Y (LORAN only), and /M (TACAN only) aircraft do not have transponders. Primary-only aircraft can be assigned flight plans, and fly IFR. It's not common, though, because aircraft that will fly within 30 miles of class B airspace, or aircraft that will operate above 10,000 feet MSL are required to be equipped with transponders and Mode C altitude reporting, similar to the ADS-B requirements. (14 CFR § 91.215)