The touch screen voting machines my county used until last May recorded the votes on a paper tape (called real time audit log) inside the machine as well as kept in memory. At poll closing, a device called a PEB was plugged into each machine to collect its vote totals (it communicated over an optical interface) and each machine had a flash card to save that data also. The PEB was then plugged into a machine again to tally and print 2 copies of the local results. One of the results tape, the PEB, and all the flash cards were returned to the Board of Elections. Redundancy all over the place, though I suppose a hacked PEB can infect the whole setup.
My county now uses a ballot card voting system. One machine with a touch screen interface is used by the voter to make their choices, much like the previous system (new one made by same company). When done, it prints a ballot card that they take over and insert in a ballot counter. The counter scans the card and spits it back if it doesn't like it (a blank card falls into that category), otherwise it records the votes and drops the card into a locked, sealed compartment. Each machine has USB stick accessible behind a locked panel. At the end of the day, the ballot counter prints 2 copies of a results tape and the cast ballots and USB sticks are retrieved and returned to the BOE. If you don't want to use the ballot marker, you can request a pre-printed ballot with the traditional fill-in-the-ovals that the ballot counter can scan and ingest as well.