I would start by modelling some basic interfaces (in the OOP sense, not the GUI sense). Seems to me you'll have a Node which will accept a collection of inputs and a single output. You didn't give any indication of how broad the data types are, but you'll want some suitable method of representing your inputs/outputs. For your first goal, this could be an integer.
In some generic C style OOP language (hope it makes sense):
class Node<T> {
Node<T>[] inputs;
T eval();
}
class AdderNode extends Node<int> {
int eval() {
int accum = 0;
for (inputs : i)
accum += i.eval();
return i;
}
}
class ConstNode<int I> extends Node<int> {
int eval() { return I; }
}
AdderNode a;
a.inputs.add(ConstNode<2>());
a.inputs.add(ConstNode<3>());
a.eval();
You could expand on this by replacing int with some abstract class, generic, or interface. Actual implementation will vary based on the actual language, of course.