Heavy flavour production and fragmentation