Hi,
It can be used in similar ways, however, 'Here it is' directs attention to the object, whereas 'here you are' puts you as the subject and points towards the action. This is actually very difficult to distinguish in certain contexts... I hope this makes sense.