There are many ECU's that have been fully opened up and re-written by aftermarket hackers. (myself being one of them...) To sum it up in a nutshell, the modern ECU has two halves. One half contains the actual code that runs. This is what manages the engine and handles the day to day stuff. The other half is best thought of as a big spreadsheet or database. That is what you target for tuning, nobody cares about how the ecu does things, what is important is the data it uses to do those things. All the information has been reverse engineered from circuit diagrams, patent applications, loose lips, and brute force (computer brute force against an ECU, not the mafia variety!)
So in essence, we aren't reprogramming the ecu. We are changing everything it knows about the world though, and then just letting it do what it does best, using the factory programming. There is a certain amount of dabbling in the factory programming of course, but its only minor things.
(the obvious disclaimer, you can blow up an engine in about 3 mouse clicks... The screen shot below is just an example of a boost table. Accidentally add a couple digits in the wrong spot, and KABOOM!
Check out
http://www.romraider.com/ This is a subaru specific program that i'm just listing as an example, but there are other communities out for other mfg's that are doing similar things.