My contractor replaced old soffits and fascia with fiber cement panels. What type of molding/cleating should be used?
It's probably only aesthetic in function, depending on how the soffit was fastened. If that wasn't the case a strip would be needed on the inside of the fascia as well. Walls and fascia tend to be a bit wavy, so it's difficult to get a perfect, caulkable fit. 
Not fibercement, but the same material that other trim moldings are made of. Something maintenance-free (or low-maintenance)--vinyl or similar. You mentioned Hardie, and they have their own line of trim boards. You can also get vinyl trim in white at big box home improvement stores.
There's probably no code for this, as it's merely aesthetic. It's unlikely to rot soon as it's well protected, and if it does it'll be from the top and back where moisture is retained and the wood is unprotected. I'd contact the contractor and ask him to replace it with something of higher quality, or at least prime and paint it.