There are two points that must be kept in mind:
1). As far as doubts and specially OCD oriented doubts are concerned, it is advised to every such person experiencing them to ignore such thoughts as much as possible because most of the times such doubts are not real and have no basis in them and they also impact the psychological and social life of the person. Unless there is something tangible, such doubts should be ignored and we Muslims should only follow rational understanding of religion which we honestly believe to be true because our accountability depends on our knowledge and on aur actions based on this knowledge and we should not betray our conscience. To understand this point further, Quran 2:286, Quran 5:48 (Discussion 79805) and Quran 2:187 (https://www.javedahmedghamidi.org/#!/quran?chapter=2¶graph=88&type=Ghamidi) should be read carefully.
2). As far as this specific issue which was asked in the question is concerned, it must be kept in mind that as long as one stays clear from Major sin of adultery and other open vulgarities (i.e. the ones which involves exposure of private parts in front of a non-eligible person etc.) then Allah has promised that He will forgive all minor sins in these domains with his mercy. It is a great virtue to be conscious of even minor lapse while interacting with the opposite gender but in case one thinks that one has erred in a certain interation and his eyes may be slipped in the wrong direction, then such unintentional lapses will Insha’Allah be forgiven by Allah if one stays clear of the major sins. See Quran 42:37 (https://www.javedahmedghamidi.org/#!/quran?chapter=42¶graph=19&type=Ghamidi).
Also lust is not always a bad feeling, it can be a useful emotion when used in the right way. It is because if this feeling, male and female get attracted to each other in a way which leads to future generation and hence human population grows. Love and affection are also very valuable feelings and they also develop with time. Both these feelings are useful for both human growth and for growth of human population, it is the balance which is required in religion when dealing with these feelings and for this balance, Islam wants these feelings of both lust and love to be excercised through an institution of marriage so that any extreme form that these feelings may lead to, should be countered via institution of marriage by putting them an umbrella of responsibility which will ensure proper balance in expression of these feelings.