Thanks Leo for the reply.
I fixed the issue.
The reason for the failure was, the source IFeatureClass did not belong to the Geoemtric Network. It was a "NORMAL" feature class. That's why, the cast was failing.When I used the feature class from the GN, it got casted to INetworkClass. So, my same code worked without any change.
Cheers,
Kiran.