Adding an address to a node's address field programmatically
I provided a code example using entity_metadata_wrapper() in this issue. As soon as I finish cleaning up the issue queue, I'll make a regular documentation page out of that. You can follow this issue to see when the documentation page gets published.