When Hamlet is with Horatio we get to see a softer side to the main character. He is honest and his guard is down a bit. When Horatio first approaches Hamlet in scene 2 he addresses Hamlet as "my lord" and calls himself "your poor servent." This shows his deferential stance, but Hamlet immediately corrects that language and call him friend; he says, "I'll change that name (servant) with you." Hamlet clearly respects Horatio and is very glad to see him. As the conversation progresses we get a glimpse of Hamlet's sarcastic humor when he talks about how quickly the marriage followed the funeral. Hamlet lets down his guard when he reveals that he still thinks he sees his father -- he means in his memory. He is clearly still a state of shock and mourning for his father.
Once Horatio reveals the story of his ghost sighting, Hamlet becomes excitable and asks many questions about it. Hamlet is merely gathering information, and trusts Horatio's understanding of the situation. At the end of the conversation, Hamlet again affirms their close relationship. Horatio and the guards talk about their loyalty, but Hamlet amends their comment and states that they are loyal out of "your loves, as mine to you."
All that said, Hamlet will not let Horatio talk him out his quest to meet and talk with the ghost no matter what dangers the ghost may bring. In the end, he demands that the men all swear to keep the ghost a secret, but he obviously trusts them enough to believe them when they swear. He never brings up their loyalty again -- he has absolute trust in Horatio.