At first the Demon Lord is invulnerable, but even though he focuses on defense, he can still dish out quite a punch, so be careful. As you won't be able to damage him you need to find alternate means - push him to the edge of the platform and throw him down. Just as he falls, use a fatal blow to drop down on him. He will now occasionally stretch out his hands trying to catch your blade. Cut between them to avoid that from happening, but not that each time you hit him he will change the angle, so be careful.
Repeat this three times and he will fall to the ground, pulling out his sword. The ensuing sword duel is by no means easy, Ghirahim has a rather long range to his attacks, and the only way to damage him is to parry his attack with your shield and use the small opening to stab him in his chest. He will shoot shock waves at you from time to time, but they're easy enough to dodge. Just like before, you can block his dagger barrage with your shield. Continue this pattern for a bit, and after a few hits Ghirahim will pull out his final weapon.
Parrying alone won't work anymore as he will block with his broadsword. The tricks is to watch how he angles the sword when he blocks. If it's horizontal - do a vertical spin attack, if it's vertical, do a sideways spin attack. After you chipped away a part of the sword he will switch the angle. Now it's not only important whether you attack it vertically or horizontally, but also which direction you do it from, as you want to avoid hitting the side which you already chipped away at. A third block alteration will occur once you chip away at the other side as well, at which point you just have to hit the core of the blade to shatter it and stun Ghirahim, allowing you to stab him.
Repeat this twice to finally bring him down.