You're likely thinking of The Case Study of Vanitas.
In this anime, the protagonist Noé carries a cursed grimoire belonging to the vampire Vanitas, which allows him to see a small, ghostly girl named Vanitas residing in his left hand. Throughout the story, Noé attempts to uncover why Vanitas is trapped within him and ultimately seeks to return her to her original body.
Is this the anime you were thinking of? Let me know if you have any other details about the show you remember!