The working principle is simple, and it takes just three parts to do what the ZXCT1009 does:
The opamp will try to keep the voltage drops across \$R_{SENSE}\$ and the 100\$\Omega\$ equal by controlling the current through the 100\$\Omega\$ resistor. So if your \$R_{SENSE}\$ is 1\$\Omega\$ the collector current will be 1/100th of that, or 100\$\mu\$A if your microcontroller draws 10mA. If you place a 10k\$\Omega\$ resistor between emitter and ground you get 1V/10mA out.
Yes, a resistor + a transistor + an opamp is cheaper than the Zetex device. But you have to pay attention to the details. \$V_{SENSE+}\$ will be your battery voltage, also your opamp's power supply. At 5mA the input voltages will be 5mV below the power supply. Obviously that calls for a Rail-to-Rail opamp. But 5mV is very close, so you start digging in datasheets if the opamp can handle it. (Don't bother, the datasheet doesn't say.)
Anyway, is it worth it? Not to me. The ZXCT1009 costs 1 dollar in 1's and is 1% accurate. It might be different if I would need 100k/year of them, but for just one? If you can't afford the dollar perhaps you've chosen the wrong hobby.