I'm going to eat dinner with a friend.

Literal

Friend [with-と] dinner [object-を] eat [purpose-に] go.

~に行く marks the purpose of going — 食べに行く means 'go in order to eat.' The masu-stem of the verb (食べ) attaches directly to に. 夕ご飯 is a common casual word for dinner, with the honorific prefix ご-.