If you're playing Ike, Olimar shouldn't totally outrange you, if at all - from my experience Oli's range is kind of lacking. It seems more like a complete speed issue. Your sword range is pretty nasty compared to his Pikmin's range with the exception of, say, his F-smash or grab, they just come out faster, so be careful when it comes to contending him, and plan beforehand. Don't underestimate your own range at all, and just keep your faster moves ready to throw out. Your Jab and D-tilt can make quick work of him on ground, and B-air is pretty good at contesting any approaches in air.
The things you really have to be afraid of are his Pikmin latching on to you. If they cling to you, they can really muck with your side-B, so be rid of them with whatever moves you can so you have less trouble recovering. This usually just happens naturally while attacking anyway, so don't focus on it unless you really feel you need to. If you're approaching, just power through them (Unless they're Purple! Then you can't!) and strike back as quick as you can, and the Pikmin should fall, too. It should also be noted that his Pikmin's latching attacks can be countered, giving you a new attack option that can even hit Oli himself quite hard, should you feel it's use neccisary to clear his Pikmin off you.
Other than that, I think he only really contests you on the ground, so keeping him airborne can give you a huge advantage, especially as it stops him plucking Pikmin. If you can't seem to do so, remember that your D-tilt comes out pretty fast, and knocks opponents into the air too, as does Eruption (Neutral-B) if you really feel lucky. Your grabs might not go to use much, but if you can get him shielding often, remember to knock him upward or offstage, and start racking up the damage.
I find that simply approaching with an air is usually a good way to go about starting up things, as it keeps you out of the way of a few of his stronger ground options, and gives you the chance to mix-up by landing and quickly throwing out a grab if he starts shielding your approaches, maybe even a d-tilt or jab-string if you wanna try and catch him OoS. N-air is a good option for this, as it hits opponents slightly upward, and you can use it for a chance for a follow-up when you feel especially confident. It's kind of hard to hit with though, so I'd stick with F-air if you want something a bit more reliable hit-wise.
Lastly, the best advice I can give is that his recovery is really punishable with Eruption, which is also a kill move that knocks opponents upwards, so start charging for this pretty much every chance you can unless he has a Purple Pikmin to interrupt with - and again, do not underestimate your range. Swing slightly earlier than usual at almost all times when approaching and beat that speed with your range.
Hope this helps some. I'm no expert, but I assume some of this will help atelast.