Depends on the difficulty. If it's Dark Souls difficulty where everything is very fair and there's always a simple solution to all the problems it throws at you if you're willing to experiment a little and learn from your previous mistakes then the difficulty is rewarding and finally getting past that one little bit that tarpitted you last time always feels good. Or the difficulty of a good puzzle game where, if you just took some time to think about it then the solution becomes obvious and you'll wonder why it was so hard in the first place (Myst is a good example of this).
However, if it's difficult because it's broken or just being difficult for difficulty's sake then it's not quite as fun, you do get that same sense of achievement sometimes, but most of the time it's not because you stopped to try a new strategy that fitted the situation or because you managed to figure out the proper combination of items required to solve a puzzle it's just because you brute forced your way through by either smashing your head against a wall before you finally broke through or you exhausted every other possible option and just managed to get the right one by sheer luck.
So, difficulty for me is only fun when it's rewarding in some way. Dark Souls is the most obvious example and you always hear people in the community singing its praises, but it's because they've experienced it themselves and can vouch for it. There's something satisfying to learning how to parry correctly, or figuring out one of the little secrets, or beating the Taurus demon by using the plunging attacks a few times to whittle him down. I could go on with everything that have given me a big smile on my face, but that's off-topic.
It's about finding that balance that Dark Souls has struck so well, its been compared with the older Nintendo titles with a similar punishing-yet-rewarding level of difficulty, like Super Metroid, Megaman or Castlevania, where knowing where that wall turkey is, or where to stock up on power bombs is part of what makes the game fun. Getting stuck on a boss in those games is frustrating for a while but you eventually work out what strategy works best against them and how to take them down efficiently and it's rewarding to know that the mistakes you make are your fault for not doing something you know you should've done but weren't fast enough or skilled enough to pull off at that moment, not because the game was just being cheap.
That's how Dark Souls does it, too, you should've kept your eye on your HP, you should've gotten a tiny bit more out of range before you healed, you shouldn't have run around that blind corner when you knew that the game likes to put something there to murder you. And the next time you come back, you remember these things and you get a little further, you learn to be cautious and how to better protect yourself on the next run. So even making it to the next bonfire is a huge achievement but also a burden because all those enemies you just killed on the way are back and there's more to come, too.
Anyway, I've been rambling way too much. Go play Dark Souls and the sequel, seriously, play it. It's just incredible.