BTW, ANZAC was an unknown military moniker before the Allies got to Gallipoli and suddenly realised they had a few shipfuls of colonial soldiers, so decided to give them a name (as you do); since they were from NZ (and the other place, Australia), they called them an "Army Corps", the Australian and New Zealand one. Both countries were in the war because of something called "patriotic duty to the motherland", or England called on its "colonial forces", to come and shed a bit of blood for them, which we both did, in considerable amounts.
At Gallipoli, they handed its command over to some Aussie git, which didn't go down so well with the Kiwis, but there it is - it was some Aussie general who got all the "glory". I don't think anything got signed, it's just the accepted name (since Gallipoli) for the combined forces of Aussie and NZ, and it's survived for the now.
P.S. I don't think there are any ANZAC forces serving in Iraq or Afghanistan. But under ANZUS, I know NZ has intelligence agents over there and a few soldiers in Afghanistan - of course, all the guv'nor will say is that there are "SIS forces deployed as part of our ANZUS obligations", so no-one really knows. ANZAC is more a sort of military "pact", at the time it was an agreement by both NZ and Australia to serve under a British flag during WW1; the name came later on, as a bit of military book-keeping - so they could label the symbols on battlefield maps, maybe...?