Controlling magnetostructural transition and magnetocaloric effect in multi-component transition-metal-based materials