I have not read the manga for Bleach (aside for the Thousand Year War arc) and have only watched the anime. I wanted to know if they dive into Gin and Matsumoto's relationship deeper in the manga. It seems that they were really good friends, but I'm curious to know if they were also in love. So my question is, what is the context of their relationship in the manga, assuming more about them is explained?
With regards to Gin and Rangiku's relationship, the anime does not significantly deviate from the manga. I do not recall all the details of every chapter, but the Bleach wiki pages for Gin and Rangiku does not mention anything different from the anime.
Given how Gin spent 100 years and even betrayed Soul Society to get revenge just for making Rangiku cry, it is very unlikely this was "just friends". Likewise, Rangiku seemed to be having feelings for Gin, though there is less evidence of that.
Well, if you read Gin Ichimaru's Wikipedia Quotes, he states to Rangiku in his dying thought:
"If you were to turn into a snake tomorrow and begin devouring humans, and from the same mouth you started devouring humans, you cried out to me 'I love you,' would I still be able to say 'I love you' the same way I do today?"
To me that says he loves Rangiku, and there are other evidences that he does.
For instances, when he says
"It would have been nice if my capture lasted a little longer. Farewell, Rangiku. Sorry."
because he was leaving her again.